+++ /dev/null
-bin_SCRIPTS += gbuild
-
-SUBSTITUTIONS = sed -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON),
-
-gbuild: src/gbuild.in Makefile
- $(AM_V_GEN) $(SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@
- @chmod a+x $@
-
-CLEANFILES += gbuild
--- /dev/null
+bin_SCRIPTS += hacktree
+
+SUBSTITUTIONS = sed -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON),
+
+hacktree: src/hacktree.in Makefile
+ $(AM_V_GEN) $(SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@
+ @chmod a+x $@
+
+CLEANFILES += hacktree
--- /dev/null
+#!@PYTHON@
+# -*- Mode: Python -*-
+# Copyright (C) 2011 Colin Walters <walters@verbum.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+
+import os
+import sys
+import re
+
+import __builtin__
+
+__builtin__.__dict__['DATADIR'] = "@datarootdir@"
+
+path = os.path.join('@libdir@', 'hacktree')
+sys.path.insert(0, path)
+